!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>自动生成表格</title>
    <script>document.addEventListener('DOMContentLoaded', function() {
        fetch('item3.json')
            .then(response => response.json())
            .then(data => {
                const table = document.getElementById('myTable');
                data.forEach(item => {
                    const row = table.insertRow(-1);
                    const cell1 = row.insertCell(0);
                    const cell2 = row.insertCell(1);
                    cell1.textContent = item.year; // 使用年份作为第一列
                    cell2.textContent = item.qingdao_id; // 使用qingdao_id作为第二列
                });
            })
            .catch(error => console.error('Error loading JSON:', error));
    });
    </script>
</head>
<body>
<table id="myTable" border="1">
    <thead>
    <tr>
        <th>年份</th>
        <th>信息类型</th>
    </tr>
    </thead>
    <tbody>
    </tbody>
</table>
</body>
</html>